import {
  SUPPLIER_TYPE_SELECT_LIST,
  SUPPLIER_CATEGORY_SELECT_LIST,
  ACCOUNT_STATUS_OPTIONS
} from '@supplier/constants/common'
import { getInitialFieldsValue } from '@supplier/utils'
// 供应商管理 - 供应商账号管理
const FORM_ITEM_LIST = [
  {
    prop: 'supplierCode',
    label: '供应商代码',
    type: 'input',
  },
  {
    prop: 'supplierName',
    label: '供应商名称',
    type: 'input',
  },
  {
    prop: 'mobilePhone',
    label: '手机号码',
    type: 'input',
  },
  {
    prop: 'mainCategoryId',
    label: '主营品类',
    type: 'categorySelect',
  },
  {
    prop: 'createUser',
    label: '创建人',
    type: 'input',
  },
  {
    prop: 'createTime',
    label: '创建日期',
    type: 'datePicker',
    datePickerType: 'daterange',
    valueFormat: 'yyyy-MM-dd'
  },
  {
    prop: 'supplierType',
    label: '供应商类型',
    type: 'select',
    clearable: true,
    options: SUPPLIER_TYPE_SELECT_LIST
  },
  {
    prop: 'supplierClassify',
    label: '供应商分类',
    type: 'select',
    clearable: true,
    options: SUPPLIER_CATEGORY_SELECT_LIST
  },
  {
    prop: 'belongDepartment',
    label: '归属中心',
    type: 'select',
    clearable: true,
    dict: 233
  },
  {
    prop: 'managementAreaId',
    label: '管理区域',
    type: 'managementArea'
  },
  {
    prop: 'businessContactName',
    label: '业务对接人',
    type: 'input'
  },
  {
    prop: 'status',
    label: '账号状态',
    type: 'select',
    clearable: true,
    options: ACCOUNT_STATUS_OPTIONS
  },
]
const FORM_DATA = getInitialFieldsValue(FORM_ITEM_LIST);
const TABLE_COLUMNS = [
  {
    title: '序号',
    key: 'index',
    width: 55
  },
  {
    title: '供应商编码',
    key: 'supplierCode',
  },
  {
    title: '供应商名称',
    key: 'supplierName'
  },
  {
    title: '账号状态',
    key: 'statusName'
  },
  {
    title: '关闭原因',
    key: 'closeReason'
  },
  {
    title: '手机号',
    key: 'mobilePhone'
  },
  {
    title: '主营品类代码',
    key: 'mainCategoryCode',
  },
  {
    title: '主营品类',
    key: 'mainCategory',
  },
  {
    title: '供应商分类',
    key: 'supplierClassifyName',
  },
  {
    title: '供应商类型',
    key: 'supplierTypeName',
  },
  {
    title: '管理区域',
    key: 'managementAreaName',
  },
  {
    title: '供应商归属中心',
    key: 'belongDepartmentName'
  },
  {
    title: '业务对接人',
    key: 'businessContactName',
  },
  {
    title: '创建人',
    key: 'createUser'
  },
  {
    title: '创建日期',
    key: 'createTime',
  }
]
export {
  FORM_ITEM_LIST,
  FORM_DATA,
  TABLE_COLUMNS
}
